// 订单
import http from '../utils/http.js';

/**
 * 购物车预下单
*/
export const GetOrderCat = (data)=>{
    return http.post('/auth/order/car',data)
}

/**
 * 商品预下单
*/
export const GetOrderGoods = (data)=>{
    return http.post('/auth/order/goods',data)
}

/**
 * 订单生成
*/
export const GetOrderCreate = ()=>{
    return http.post('/auth/order/create')
}

/**
 * 订单支付
*/
export const GetOrderPay = (orderId)=>{
    return http.post(`/auth/order/pay/${orderId}`)
}

/**
 * 订单列表查询
*/
export const GetOrderList = (data)=>{
    return http.get('/auth/order/page',data)
}

/**
 * 商品退款
 */
export const orderRefund = (data)=>{
    return http.post('/auth/order/refund',data)
}

/**
 * 订单商品查询
*/
export const GetOrderGood = (orderId,data)=>{
    return http.get(`/auth/order/goods/${orderId}`,data)
}

/**
 * 用户确认收货
*/
export const GetOrderReceive = (orderId)=>{
    return http.put(`/auth/order/order/receive/${orderId}`)
}

/**
 * 订单取消
*/
export const GetOrderCancel = (orderId)=>{
    return http.put(`/auth/order/cancel/${orderId}`)
}

/**
 * 商品退款
*/
export const GetOrderRefund = (data)=>{
    return http.post(`/auth/order/refund`,data)
}

/**
 * 订单评论
*/
export const GetOrderComment = (data)=>{
    return http.post(`/auth/order/comment/add`,data)
}

/**
 * 商品评论查询
*/
export const GetOrderCommentList = (goodId)=>{
    return http.get(`/auth/order/comment/page/${goodId}`,)
}

/**
 * 商户确认收货
*/
export const GetOrderReceiveShop = (orderId)=>{
    return http.put(`/auth/order/order/receive/store/${orderId}`)
}

/**
 * 售后单
 * GET
 * /auth/order/refund/page
 */
export const GetRefundPage = (data)=>{
    return http.get(`/auth/order/refund/page`,data)
}